/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.deployment.dao;

import br.com.deployment.daogenerico.DaoGenerico;
import br.com.deployment.entidade.tramite.Situacao;
import br.com.deployment.interfaces.SituacaoDaoIn;
import java.util.List;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;
import javax.persistence.Query;

/**
 *
 * @author roniere
 */
@Stateless
@LocalBean
public class SituacaoDao extends DaoGenerico<Situacao> implements SituacaoDaoIn{

    public SituacaoDao() {
        super(Situacao.class);
    }

    @Override
    public List<Situacao> find(Situacao entity) {
         String sql = "Select s from Situacao s where s.nome like :nome";
        Query query = getEm().createQuery(sql);
        query.setParameter("nome", "%"+entity.getNome()+"%");
        return query.getResultList();
    }
   
}
